feat(web): pull request files can be marked as viewed - #7721
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
There was a problem hiding this comment.
Reviewed the changed web UI: the new viewed-file checkbox in the diff header, the counter in the toolbar, and the fold/overlay logic modules. Two findings, both on changed lines in PullRequestCodeTab.tsx.
Posted via Macroscope — UI Consistency
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR introduces a substantial GitHub-only review workflow spanning the UI, client/server RPCs, caching and concurrency, and external GraphQL mutations. It also changes authorization code, so the breadth and sensitivity of the runtime path warrant human review. You can add or adjust custom eligibility rules. Learn more. |
There was a problem hiding this comment.
Reviewed the web UI changes (PullRequestCodeTab.tsx, pullRequestDiff.logic.ts, pullRequestFilesViewed.logic.ts, usePullRequestFilesViewed.ts) for shared-primitive use, Tailwind/CSS ownership and virtualizer behavior.
Both findings from the previous run are resolved: the Checkbox no longer carries a partial size-* override, and truncated is now threaded through the hook and surfaced in the meta line with the same Tooltip + TriangleAlertIcon treatment the withheld-diff caveat uses. Two remaining items below — one virtualizer regression risk, one accessible-name issue on the new control.
Posted via Macroscope — UI Consistency
A review spread over an afternoon, or picked up on a second machine, started again from the top every time, so large changes were read in the browser and only small ones stayed here. The marks are the host's rather than ours because a checkbox only this app remembers is worse than none: it looks like the one GitHub shows, disagrees with it, and leaves a reviewer unsure which of the two knows what they have actually read. Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
…he window resets Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
…since Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
…at it is partial Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
…he wrong way Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
…count Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
…carries Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
A press moved the whole viewed view, and every file header on screen was memoized on it, so one tick cost a rebuild of all of them. The same mark also has to say whether the control is offered at all, or a capability arriving after the first paint leaves the headers without a box. Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
It borrowed its name from the label beside it, and that label turns into "Changed" once the file has been pushed to, leaving a reader who cannot see it with no idea what the box does. Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
1296cb6 to
6b44e51
Compare
Screen.Recording.2026-08-20.at.6.15.29.PM.mov |
The branch had drifted behind main far enough to conflict, which blocked review of the change itself. Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 28eea17. Configure here.
The button exists for a reader who can see that what they are looking at is behind, so leaving one part of the page on the last read defeats the point of pressing it. A push since that read is exactly when the mark beside a ticked file stops being true. Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
An error the reader cannot act on, about a press they have already replaced, reads as their current tick having been lost when it has not. Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
There was a problem hiding this comment.
One finding on the new viewed-files hook: the command-failure path surfaces an error toast for interrupt-only failures, which diverges from the repo's established useAtomCommand failure convention. Everything else in the web scope (Checkbox/Tooltip primitive use, the amber caveat icon matching the adjacent meta-line pattern, header portal render-prop stability via refs, explicit environmentId threading) looks consistent.
Posted via Macroscope — UI Consistency
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>

Note
Medium Risk
New orchestration RPCs and GitHub GraphQL read/write paths with separate caching; mistakes could desync UI from GitHub or over-fetch, but scope is PR review UX rather than auth or data integrity.
Overview
Adds GitHub-only “viewed file” tracking for pull request reviews: readers can tick files in the Code tab, see a viewed count, and get a Changed hint when GitHub reports the file moved after it was marked viewed. State is stored on the host (not local-only) and is gated by a new
viewedFilescapability so other providers hide the control.Backend: New
pullRequests.filesViewed/pullRequests.setFilesViewedRPCs (read vs operate auth), contract types (PullRequestFileViewedState, batch set input), andPullRequestServicemethods with a dedicated 15s cache andfilesViewedEpochinvalidation so ticking files does not drop the diff cache. GitHub reads paginate GraphQL fileviewerViewedState(cap 5 pages,truncatedflag); writes batchmarkFileAsViewed/unmarkFileAsViewedin one mutation with paths as variables.Web:
usePullRequestFilesViewedloads host state, optimistic overlay, 400ms debounced batched writes, serial commands per PR, and revert-on-error;PullRequestCodeTabadds per-file checkboxes (fold on mark viewed), meta count, and refresh resets diff + viewed state together.Reviewed by Cursor Bugbot for commit 3c279bf. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add per-file 'Viewed' marking for pull requests in Code tab
PullRequestFileViewedState,PullRequestFilesViewedResult,PullRequestSetFilesViewedInput), WebSocket RPCs (pullRequests.filesViewed,pullRequests.setFilesViewed), and server-side GitHub GraphQL queries/mutations with pagination capped at 5 pagesusePullRequestFilesViewedhook with optimistic UI overlay, 400ms debounced batch writes, overlapping-request tracking, and toast on failure; integrates a 'Viewed'/'Changed' checkbox into file headers in PullRequestCodeTab.tsx that folds/unfolds the file diff to match viewed statefilesViewedresults (128 entries, 15s TTL) with a separate epoch sosetFilesViewedinvalidates only the viewed-files cache without touching the diff cache; capability gating viaviewedFilesflag onPullRequestCapabilitiessetFilesViewedon GitHub builds a single batched GraphQL mutation with aliasedmarkFileAsViewed/unmarkFileAsViewedoperations; if GitHub rejects aliased batch mutations beyond a size limit, large PRs may fail silently — verifybuildSetFilesViewedGraphQlMutationin gitHubPullRequestJson.ts handles GitHub's mutation alias limitsMacroscope summarized 3c279bf.